package com.macro.mall.portal.dao;

import com.macro.mall.model.CheckStorageVo;
import com.macro.mall.model.PmsStock;
import com.macro.mall.model.PmsStockExample;
import com.macro.mall.model.WmsCreateCheckStorageDto;
import com.macro.mall.portal.domain.AgentSkuListResult;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface PmsStockDao {
    long countByExample(PmsStockExample example);

    int deleteByExample(PmsStockExample example);

    int deleteByPrimaryKey(Long id);

    int insert(PmsStock record);

    int insertSelective(PmsStock record);

    List<PmsStock> selectByExample(PmsStockExample example);

    PmsStock selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") PmsStock record, @Param("example") PmsStockExample example);

    int updateByExample(@Param("record") PmsStock record, @Param("example") PmsStockExample example);

    int updateByPrimaryKeySelective(PmsStock record);

    int updateByPrimaryKey(PmsStock record);


    /**
     * 获取盘点商品列表
     * @author 孙晓亮
     * @Date 2020年9月14日
     * @param pmsStockExample
     * @return
     */
    List<CheckStorageVo> getCheckProductList(PmsStockExample pmsStockExample);

    /**
     * 计算pms_stock表中相同的sku_stock_id的stock总数量
     * @return
     */
    List<Map<String, Object>> skuCountList();

    /**
     * 批量修改
     * @param wmsCreateCheckStorageDtoList
     */
    void updateCheckStock(@Param("WmsCreateCheckStorageDto") List<WmsCreateCheckStorageDto> wmsCreateCheckStorageDtoList);

    /**
     * 获取经纪人库存
     * @param agentId
     * @return
     */
    List<AgentSkuListResult> getAgentSkuList(@Param("agentId") Long agentId, @Param("productCategoryId") Long productCategoryId);
}